package com.ruoyi.tzai.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 用户播放历史对象 tzai_user_play_history
 * 
 * @author tzai
 * @date 2025-10-27
 */
public class UserPlayHistory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 历史ID */
    private Long historyId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 文章ID */
    @Excel(name = "文章ID")
    private Long articleId;

    /** 播放语言 */
    @Excel(name = "播放语言", readConverterExp = "cn=中文,en=英文")
    private String language;

    /** 播放进度(秒) */
    @Excel(name = "播放进度(秒)")
    private Integer playProgress;

    /** 总时长(秒) */
    @Excel(name = "总时长(秒)")
    private Integer duration;

    /** 是否播放完成(0否 1是) */
    @Excel(name = "是否播放完成", readConverterExp = "0=否,1=是")
    private String isFinished;

    /** 最后播放时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后播放时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastPlayTime;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public Long getHistoryId() {
        return historyId;
    }

    public void setHistoryId(Long historyId) {
        this.historyId = historyId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public Integer getPlayProgress() {
        return playProgress;
    }

    public void setPlayProgress(Integer playProgress) {
        this.playProgress = playProgress;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public String getIsFinished() {
        return isFinished;
    }

    public void setIsFinished(String isFinished) {
        this.isFinished = isFinished;
    }

    public Date getLastPlayTime() {
        return lastPlayTime;
    }

    public void setLastPlayTime(Date lastPlayTime) {
        this.lastPlayTime = lastPlayTime;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("historyId", getHistoryId())
            .append("userId", getUserId())
            .append("articleId", getArticleId())
            .append("language", getLanguage())
            .append("playProgress", getPlayProgress())
            .append("duration", getDuration())
            .append("isFinished", getIsFinished())
            .append("lastPlayTime", getLastPlayTime())
            .append("createTime", getCreateTime())
            .toString();
    }
}

